Merge in Win32 version: Define macro GDKVAR for declaring gdk variables
authorTor Lillqvist <tml@src.gnome.org>
Wed, 17 Mar 1999 23:02:10 +0000 (23:02 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Wed, 17 Mar 1999 23:02:10 +0000 (23:02 +0000)
* gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
declaring gdk variables exported/imported from the DLL. New image
type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
GDK_DRAG_PROTO_OLE2.

* gdk/gdk.h: Merge in Win32 version: Two new functions,
gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
declared only for the Win32 version, but could be in the X11
version as well. (Needed for a Xlib-less gdk_imlib.)
gdk_color_hash should have only one parameter. Declare
gdk_threads_mutex with GDKVAR.

* gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
just one parameter.

* gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
per pixel, not bits.

* gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
Fetch bpp (which means bits-per-pixel here) from another place on
Win32. Accept also depth==32 (which we might get on Win32) with
bpp==32.

* gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
in the backend-dependent directory, not in the common gdk
directory.

* gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
headers.

32 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdk.h
gdk/gdkcolor.c
gdk/gdkimage.c
gdk/gdkrgb.c
gdk/gdktypes.h
gdk/x11/gdkcolor-x11.c
gdk/x11/gdkimage-x11.c
gtk/gtkclist.c
gtk/gtkctree.c
gtk/gtkdnd.c
gtk/gtkeditable.c
gtk/gtkfontsel.c
gtk/gtkhandlebox.c
gtk/gtklayout.c
gtk/gtkmain.c
gtk/gtkplug.c
gtk/gtkpreview.c
gtk/gtkrc.c
gtk/gtkselection.c
gtk/gtksocket.c
gtk/gtkstyle.c
gtk/gtkwidget.c
gtk/gtkwindow.c
gtk/testgtk.c
tests/testgtk.c

index e2079afb459aa0ffbf3e319fd00ef9394ec0f74c..ac50b97a15b81323da1fc379969ffd23d2a506ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+1999-03-18  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+       declaring gdk variables exported/imported from the DLL. New image
+       type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+       drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+       GDK_DRAG_PROTO_OLE2.
+
+       * gdk/gdk.h: Merge in Win32 version: Two new functions,
+       gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+       declared only for the Win32 version, but could be in the X11
+       version as well. (Needed for a Xlib-less gdk_imlib.)
+       gdk_color_hash should have only one parameter. Declare
+       gdk_threads_mutex with GDKVAR.
+       
+       * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+       just one parameter.
+
+       * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+       per pixel, not bits.
+
+       * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+       Fetch bpp (which means bits-per-pixel here) from another place on
+       Win32. Accept also depth==32 (which we might get on Win32) with
+       bpp==32.
+
+       * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+       gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+       gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+       Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+       in the backend-dependent directory, not in the common gdk
+       directory.
+
+       * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+       headers.
+
 Wed Mar 17 05:06:49 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkmain.c (gtk_init_check): tell people that they don't really
index e2079afb459aa0ffbf3e319fd00ef9394ec0f74c..ac50b97a15b81323da1fc379969ffd23d2a506ba 100644 (file)
@@ -1,3 +1,39 @@
+1999-03-18  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+       declaring gdk variables exported/imported from the DLL. New image
+       type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+       drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+       GDK_DRAG_PROTO_OLE2.
+
+       * gdk/gdk.h: Merge in Win32 version: Two new functions,
+       gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+       declared only for the Win32 version, but could be in the X11
+       version as well. (Needed for a Xlib-less gdk_imlib.)
+       gdk_color_hash should have only one parameter. Declare
+       gdk_threads_mutex with GDKVAR.
+       
+       * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+       just one parameter.
+
+       * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+       per pixel, not bits.
+
+       * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+       Fetch bpp (which means bits-per-pixel here) from another place on
+       Win32. Accept also depth==32 (which we might get on Win32) with
+       bpp==32.
+
+       * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+       gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+       gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+       Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+       in the backend-dependent directory, not in the common gdk
+       directory.
+
+       * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+       headers.
+
 Wed Mar 17 05:06:49 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkmain.c (gtk_init_check): tell people that they don't really
index e2079afb459aa0ffbf3e319fd00ef9394ec0f74c..ac50b97a15b81323da1fc379969ffd23d2a506ba 100644 (file)
@@ -1,3 +1,39 @@
+1999-03-18  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+       declaring gdk variables exported/imported from the DLL. New image
+       type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+       drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+       GDK_DRAG_PROTO_OLE2.
+
+       * gdk/gdk.h: Merge in Win32 version: Two new functions,
+       gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+       declared only for the Win32 version, but could be in the X11
+       version as well. (Needed for a Xlib-less gdk_imlib.)
+       gdk_color_hash should have only one parameter. Declare
+       gdk_threads_mutex with GDKVAR.
+       
+       * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+       just one parameter.
+
+       * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+       per pixel, not bits.
+
+       * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+       Fetch bpp (which means bits-per-pixel here) from another place on
+       Win32. Accept also depth==32 (which we might get on Win32) with
+       bpp==32.
+
+       * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+       gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+       gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+       Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+       in the backend-dependent directory, not in the common gdk
+       directory.
+
+       * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+       headers.
+
 Wed Mar 17 05:06:49 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkmain.c (gtk_init_check): tell people that they don't really
index e2079afb459aa0ffbf3e319fd00ef9394ec0f74c..ac50b97a15b81323da1fc379969ffd23d2a506ba 100644 (file)
@@ -1,3 +1,39 @@
+1999-03-18  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+       declaring gdk variables exported/imported from the DLL. New image
+       type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+       drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+       GDK_DRAG_PROTO_OLE2.
+
+       * gdk/gdk.h: Merge in Win32 version: Two new functions,
+       gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+       declared only for the Win32 version, but could be in the X11
+       version as well. (Needed for a Xlib-less gdk_imlib.)
+       gdk_color_hash should have only one parameter. Declare
+       gdk_threads_mutex with GDKVAR.
+       
+       * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+       just one parameter.
+
+       * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+       per pixel, not bits.
+
+       * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+       Fetch bpp (which means bits-per-pixel here) from another place on
+       Win32. Accept also depth==32 (which we might get on Win32) with
+       bpp==32.
+
+       * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+       gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+       gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+       Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+       in the backend-dependent directory, not in the common gdk
+       directory.
+
+       * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+       headers.
+
 Wed Mar 17 05:06:49 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkmain.c (gtk_init_check): tell people that they don't really
index e2079afb459aa0ffbf3e319fd00ef9394ec0f74c..ac50b97a15b81323da1fc379969ffd23d2a506ba 100644 (file)
@@ -1,3 +1,39 @@
+1999-03-18  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+       declaring gdk variables exported/imported from the DLL. New image
+       type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+       drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+       GDK_DRAG_PROTO_OLE2.
+
+       * gdk/gdk.h: Merge in Win32 version: Two new functions,
+       gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+       declared only for the Win32 version, but could be in the X11
+       version as well. (Needed for a Xlib-less gdk_imlib.)
+       gdk_color_hash should have only one parameter. Declare
+       gdk_threads_mutex with GDKVAR.
+       
+       * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+       just one parameter.
+
+       * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+       per pixel, not bits.
+
+       * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+       Fetch bpp (which means bits-per-pixel here) from another place on
+       Win32. Accept also depth==32 (which we might get on Win32) with
+       bpp==32.
+
+       * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+       gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+       gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+       Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+       in the backend-dependent directory, not in the common gdk
+       directory.
+
+       * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+       headers.
+
 Wed Mar 17 05:06:49 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkmain.c (gtk_init_check): tell people that they don't really
index e2079afb459aa0ffbf3e319fd00ef9394ec0f74c..ac50b97a15b81323da1fc379969ffd23d2a506ba 100644 (file)
@@ -1,3 +1,39 @@
+1999-03-18  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+       declaring gdk variables exported/imported from the DLL. New image
+       type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+       drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+       GDK_DRAG_PROTO_OLE2.
+
+       * gdk/gdk.h: Merge in Win32 version: Two new functions,
+       gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+       declared only for the Win32 version, but could be in the X11
+       version as well. (Needed for a Xlib-less gdk_imlib.)
+       gdk_color_hash should have only one parameter. Declare
+       gdk_threads_mutex with GDKVAR.
+       
+       * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+       just one parameter.
+
+       * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+       per pixel, not bits.
+
+       * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+       Fetch bpp (which means bits-per-pixel here) from another place on
+       Win32. Accept also depth==32 (which we might get on Win32) with
+       bpp==32.
+
+       * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+       gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+       gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+       Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+       in the backend-dependent directory, not in the common gdk
+       directory.
+
+       * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+       headers.
+
 Wed Mar 17 05:06:49 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkmain.c (gtk_init_check): tell people that they don't really
index e2079afb459aa0ffbf3e319fd00ef9394ec0f74c..ac50b97a15b81323da1fc379969ffd23d2a506ba 100644 (file)
@@ -1,3 +1,39 @@
+1999-03-18  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
+       declaring gdk variables exported/imported from the DLL. New image
+       type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
+       drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
+       GDK_DRAG_PROTO_OLE2.
+
+       * gdk/gdk.h: Merge in Win32 version: Two new functions,
+       gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
+       declared only for the Win32 version, but could be in the X11
+       version as well. (Needed for a Xlib-less gdk_imlib.)
+       gdk_color_hash should have only one parameter. Declare
+       gdk_threads_mutex with GDKVAR.
+       
+       * gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
+       just one parameter.
+
+       * gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
+       per pixel, not bits.
+
+       * gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
+       Fetch bpp (which means bits-per-pixel here) from another place on
+       Win32. Accept also depth==32 (which we might get on Win32) with
+       bpp==32.
+
+       * gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
+       gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
+       gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
+       Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
+       in the backend-dependent directory, not in the common gdk
+       directory.
+
+       * gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
+       headers.
+
 Wed Mar 17 05:06:49 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkmain.c (gtk_init_check): tell people that they don't really
index d3afbacbe336e8769345a19c95f5cf3e7267e39b..2c3d4d2878efbb290b51cc767d21a397714290a5 100644 (file)
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -227,7 +227,7 @@ void gdk_window_set_child_shapes (GdkWindow *window);
 
 /*
  * This routine allows you to merge (ie ADD) child shapes to your
- * own window's shape keeping its current shape and ADDING the shild
+ * own window's shape keeping its current shape and ADDING the child
  * shapes to it.
  * 
  * - Raster
@@ -464,6 +464,15 @@ GdkPixmap* gdk_pixmap_new          (GdkWindow  *window,
                                         gint        width,
                                         gint        height,
                                         gint        depth);
+#if GDK_WINDOWING == GDK_WINDOWING_WIN32
+GdkPixmap* gdk_pixmap_create_on_shared_image
+                                       (GdkImage  **image_return,
+                                        GdkWindow  *window,
+                                        GdkVisual  *visual,
+                                        gint        width,
+                                        gint        height,
+                                        gint        depth);
+#endif
 GdkBitmap* gdk_bitmap_create_from_data (GdkWindow   *window,
                                         const gchar *data,
                                         gint         width,
@@ -512,6 +521,12 @@ GdkImage*  gdk_image_new       (GdkImageType  type,
                                GdkVisual    *visual,
                                gint          width,
                                gint          height);
+#if GDK_WINDOWING == GDK_WINDOWING_WIN32
+GdkImage*  gdk_image_bitmap_new(GdkImageType  type,
+                               GdkVisual    *visual,
+                               gint          width,
+                               gint          height);
+#endif
 GdkImage*  gdk_image_get       (GdkWindow    *window,
                                gint          x,
                                gint          y,
@@ -562,8 +577,7 @@ void      gdk_color_free (GdkColor *color);
 
 gint gdk_color_parse    (const gchar   *spec,
                          GdkColor      *color);
-guint gdk_color_hash     (const GdkColor *colora,
-                         const GdkColor *colorb);
+guint gdk_color_hash     (const GdkColor *colora);
 gint gdk_color_equal    (const GdkColor *colora,
                          const GdkColor *colorb);
 
@@ -994,7 +1008,7 @@ gboolean gdk_keyval_is_lower                 (guint        keyval);
 /* Threading
  */
 
-extern GMutex *gdk_threads_mutex;
+GDKVAR GMutex *gdk_threads_mutex;
 
 void     gdk_threads_enter                (void);
 void     gdk_threads_leave                (void);
index 3a274a8887b36309507b14cec4ab9bb466a21a63..dd9f2b27b228482baf25692873e5d544c494af66 100644 (file)
@@ -1109,8 +1109,7 @@ gdk_color_change (GdkColormap *colormap,
 }
 
 guint
-gdk_color_hash (const GdkColor *colora,
-               const GdkColor *colorb)
+gdk_color_hash (const GdkColor *colora)
 {
   return ((colora->red) +
          (colora->green << 11) +
index f2f26d95a92b338a6f2f9c38b5cb519338a70bc0..d2e66803d10dda3df22f671b2f5f352e702c19e8 100644 (file)
@@ -372,7 +372,14 @@ gdk_image_get (GdkWindow *window,
 
   image->mem = private->ximage->data;
   image->bpl = private->ximage->bytes_per_line;
-  image->bpp = private->ximage->bits_per_pixel;
+  if (private->ximage->bits_per_pixel <= 8)
+    image->bpp = 1;
+  else if (private->ximage->bits_per_pixel <= 16)
+    image->bpp = 2;
+  else if (private->ximage->bits_per_pixel <= 24)
+    image->bpp = 3;
+  else
+    image->bpp = 4;
   image->byte_order = private->ximage->byte_order;
 
   return image;
index f66d1ff87bb6ab7ec2c2f66e0923cf52d65b2366..86d6f998d12d12b068af1e512d711fd4533267fd 100644 (file)
 #else
 
 /* Compiling as a part of Gtk 1.1 or later */
-#include "../config.h"
-#include "gdk.h"
+#include "config.h"
+#include <gdk/gdk.h>
 #include "gdkprivate.h"
 
 #endif
 
-#include "gdkrgb.h"
+#include <gdk/gdkrgb.h>
 
 typedef struct _GdkRgbInfo   GdkRgbInfo;
 
@@ -2678,7 +2678,11 @@ gdk_rgb_select_conv (GdkImage *image)
   gboolean mask_rgb, mask_bgr;
 
   depth = image_info->visual->depth;
+#if defined (GDK_RGB_STANDALONE) || (GDK_WINDOWING == GDK_WINDOWING_X11)
   bpp = ((GdkImagePrivate *)image)->ximage->bits_per_pixel;
+#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
+  bpp = ((GdkVisualPrivate *) gdk_visual_get_system())->xvisual->bitspixel;
+#endif
 
   byte_order = image->byte_order;
   if (gdk_rgb_verbose)
@@ -2765,7 +2769,7 @@ gdk_rgb_select_conv (GdkImage *image)
   else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
           (mask_rgb && byte_order == GDK_MSB_FIRST))
     conv = gdk_rgb_convert_0888_br;
-  else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
+  else if (bpp == 32 && (depth == 32 || depth == 24) && vtype == GDK_VISUAL_TRUE_COLOR &&
           (mask_rgb && byte_order == GDK_LSB_FIRST))
     conv = gdk_rgb_convert_0888;
   else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
index 19406de5788b21d9a5cfadcbedae86da4d0ef5df..cae6119864b5b3506e35067c58deef0511756a7d 100644 (file)
  */
 #include <glib.h>
 
+#ifdef NATIVE_WIN32
+#  ifdef GDK_COMPILATION
+#    define GDKVAR __declspec(dllexport)
+#  else
+#    define GDKVAR extern __declspec(dllimport)
+#  endif
+#else
+#  define GDKVAR extern
+#endif
 
 /* The system specific file gdkconfig.h contains such configuration
  * settings that are needed not only when compiling GDK (or GTK)
@@ -174,18 +183,23 @@ typedef enum
 /* Types of images.
  *   Normal: Normal X image type. These are slow as they involve passing
  *          the entire image through the X connection each time a draw
- *          request is required.
+ *          request is required. On Win32, a bitmap.
  *   Shared: Shared memory X image type. These are fast as the X server
  *          and the program actually use the same piece of memory. They
  *          should be used with care though as there is the possibility
  *          for both the X server and the program to be reading/writing
  *          the image simultaneously and producing undesired results.
+ *          On Win32, also a bitmap.
+ *   Shared Pixmap: Also a shared memory image, which also has a
+ *          pixmap using the same memory. Used by gdk_imlib with the
+ *          Win32 backend.
  */
 typedef enum
 {
   GDK_IMAGE_NORMAL,
   GDK_IMAGE_SHARED,
-  GDK_IMAGE_FASTEST
+  GDK_IMAGE_FASTEST,
+  GDK_IMAGE_SHARED_PIXMAP
 } GdkImageType;
 
 /* Types of visuals.
@@ -766,7 +780,9 @@ typedef enum {
   GDK_DRAG_PROTO_XDND,
   GDK_DRAG_PROTO_ROOTWIN,      /* A root window with nobody claiming
                                 * drags */
-  GDK_DRAG_PROTO_NONE          /* Not a valid drag window */
+  GDK_DRAG_PROTO_NONE,         /* Not a valid drag window */
+  GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */
+  GDK_DRAG_PROTO_OLE2,         /* The complex OLE2 dnd (not implemented) */
 } GdkDragProtocol;
 
 /* The color type.
index 3a274a8887b36309507b14cec4ab9bb466a21a63..dd9f2b27b228482baf25692873e5d544c494af66 100644 (file)
@@ -1109,8 +1109,7 @@ gdk_color_change (GdkColormap *colormap,
 }
 
 guint
-gdk_color_hash (const GdkColor *colora,
-               const GdkColor *colorb)
+gdk_color_hash (const GdkColor *colora)
 {
   return ((colora->red) +
          (colora->green << 11) +
index f2f26d95a92b338a6f2f9c38b5cb519338a70bc0..d2e66803d10dda3df22f671b2f5f352e702c19e8 100644 (file)
@@ -372,7 +372,14 @@ gdk_image_get (GdkWindow *window,
 
   image->mem = private->ximage->data;
   image->bpl = private->ximage->bytes_per_line;
-  image->bpp = private->ximage->bits_per_pixel;
+  if (private->ximage->bits_per_pixel <= 8)
+    image->bpp = 1;
+  else if (private->ximage->bits_per_pixel <= 16)
+    image->bpp = 2;
+  else if (private->ximage->bits_per_pixel <= 24)
+    image->bpp = 3;
+  else
+    image->bpp = 4;
   image->byte_order = private->ximage->byte_order;
 
   return image;
index 5744748375c72154b87f0aef0693a801c0b55a66..ef9922b19ceeaf753054c52ee1553c6b8a5d90ae 100644 (file)
@@ -32,7 +32,7 @@
 #include "gtkclist.h"
 #include "gtkbindings.h"
 #include "gtkdnd.h"
-#include <gdk/gdkx.h>
+#include "gdkx.h"
 #include <gdk/gdkkeysyms.h>
 
 /* length of button_actions array */
index 007913a377a78b833d7574b993dbe91c104e4556..b66e60f2e682db87057d7fa8bcad71ae37d37bfd 100644 (file)
@@ -33,7 +33,7 @@
 #include "gtkbindings.h"
 #include "gtkmain.h"
 #include "gtkdnd.h"
-#include <gdk/gdkx.h>
+#include "gdkx.h"
 #include <gdk/gdkkeysyms.h>
 
 #define PM_SIZE                    8
index 5b626d91f3eb97166c822c9dec0308ab6b4008be..101e4da4cea528a09baab847af4c50451a3617b2 100644 (file)
@@ -24,7 +24,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 
 #include "gtkdnd.h"
 #include "gtkinvisible.h"
index 420c66c57c3e8fd0d0f1343770acaf5afdeeb8e7..cc68976ba94774275532e4c06b197b8bd0d77e72 100644 (file)
@@ -27,7 +27,7 @@
 #include <ctype.h>
 #include <string.h>
 #ifdef USE_XIM
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 #endif
 #include "gdk/gdkkeysyms.h"
 #include "gdk/gdki18n.h"
index b505704afc8e6c81dcd40524a9ea2d4fc2faf01a..c665bae116d0bf05f4cff7062bee07f8420d0412 100644 (file)
@@ -70,7 +70,7 @@
 #include <ctype.h>
 
 #include "gdk/gdk.h"
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 #include "gdk/gdkkeysyms.h"
 
 #include "gtkbutton.h"
index 30783ad60193fea1e5cf4d94a3f828fac68096fa..93ffbe2de6b07d4811c925294e663c45c29d57d1 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #include <stdlib.h>
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 #include "gtkhandlebox.h"
 #include "gtkmain.h"
 #include "gtksignal.h"
index cd630faa296741942bbb317aa53e1d619267de2f..3e07f84bc8490a3ed638e4efebb194d272ea3f41 100644 (file)
@@ -28,7 +28,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 
 #include "gtklayout.h"
 #include "gtksignal.h"
index 384035b31406e9981c0d40ae0f5f6c5cd7a53591..0ee8c346134c6658843b5aad447c5b4feb8b767e 100644 (file)
@@ -24,7 +24,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include "gdk/gdkx.h"          /* For GDK_WINDOWING */
+#include "gdkx.h"              /* For GDK_WINDOWING */
 
 #if GDK_WINDOWING == GDK_WINDOWING_X11
 #include <X11/Xlocale.h>       /* so we get the right setlocale */
index cf7506e32136a96612c33377eeee81c810f1e4bd..737671deb12a67fc1fcdee2b2b5bed64010fb194 100644 (file)
@@ -25,7 +25,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 #include "gdk/gdkkeysyms.h"
 #include "gtkplug.h"
 
index b32210a711b211c61d228f853e6a18d2377eeb27..02a2d9d46b664d458a38a2d2a1889eb838cc37c2 100644 (file)
@@ -32,7 +32,7 @@
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 #include "gdk/gdkrgb.h"
 #include "gtkpreview.h"
 #include "gtksignal.h"
index d5ecfc022bafd6f7c2bda892055dea0a37817ae8..93c39e4dd18a3daaf2fa941347c0f8e3c7f63424 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "config.h"
 
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 
 #if GDK_WINDOWING == GDK_WINDOWING_X11
 #include <X11/Xlocale.h>       /* so we get the right setlocale */
index 6ea50d680ebcabf5ed3df5f25f10fe84a721e4bc..d4ac3fb9feb7312e492f95e54fa2e23210d07f6b 100644 (file)
@@ -53,7 +53,7 @@
 
 #include <stdarg.h>
 #include <string.h>
-#include <gdk/gdkx.h>
+#include "gdkx.h"
 /* we need this for gdk_window_lookup() */
 #include "gtkmain.h"
 #include "gtkselection.h"
index a473213860b016d6731472f719a79a12853201df..ed1508bedb141b7b0451856dc9c13b79cb07bfe2 100644 (file)
@@ -25,7 +25,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 #include "gdk/gdkkeysyms.h"
 #include "gtkwindow.h"
 #include "gtksignal.h"
index f3984b9c552a0f530979e2f82a4dea4701a28061..c98e8c56df805abc693f6ee97c5dd42de5e9f9fb 100644 (file)
@@ -31,7 +31,7 @@
 #include "gtkthemes.h"
 #include "gtkwidget.h"
 #include "gtkthemes.h"
-#include "gdk/gdkprivate.h"
+#include "gdkprivate.h"
 
 
 #define LIGHTNESS_MULT  1.3
index bd24f74cd2304424a9b2a16bbfed3a3179f249b0..62a4347af9b27fad3a9192828be4ecfdf2c80181 100644 (file)
@@ -36,7 +36,7 @@
 #include "gtkbindings.h"
 #include "gtkprivate.h"
 #include "gdk/gdk.h"
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 
 
 #define WIDGET_CLASS(w)         GTK_WIDGET_CLASS (GTK_OBJECT (w)->klass)
@@ -2533,7 +2533,7 @@ gtk_widget_unlock_accelerators (GtkWidget *widget)
 gboolean
 gtk_widget_accelerators_locked (GtkWidget *widget)
 {
-  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
   
   return gtk_signal_handler_pending_by_func (GTK_OBJECT (widget),
                                             widget_signals[ADD_ACCELERATOR],
index 04ce74819a52b6bbb9e7ca520260aeb7ac72c11f..2310b5ce9c7c24d61115d8bb6ef6c8846d2e22a3 100644 (file)
@@ -28,7 +28,7 @@
 #include <limits.h>
 #include "gdk/gdk.h"
 #include "gdk/gdkkeysyms.h"
-#include "gdk/gdkx.h"
+#include "gdkx.h"
 #include "gtkprivate.h"
 #include "gtkrc.h"
 #include "gtksignal.h"
index 4bd90e368e693d59d15f231233b491e1c105131b..47a967f26bf8ed646a69bc64bbd467eb230b51e3 100644 (file)
@@ -32,9 +32,9 @@
 #include <math.h>
 #include <time.h>
 #include "gtk.h"
-#include "../gdk/gdk.h"
-#include "../gdk/gdkx.h"
-#include "../gdk/gdkkeysyms.h"
+#include "gdk/gdk.h"
+#include "gdk/gdkkeysyms.h"
+#include "gdkx.h"
 
 #include "circles.xbm"
 
index 4bd90e368e693d59d15f231233b491e1c105131b..47a967f26bf8ed646a69bc64bbd467eb230b51e3 100644 (file)
@@ -32,9 +32,9 @@
 #include <math.h>
 #include <time.h>
 #include "gtk.h"
-#include "../gdk/gdk.h"
-#include "../gdk/gdkx.h"
-#include "../gdk/gdkkeysyms.h"
+#include "gdk/gdk.h"
+#include "gdk/gdkkeysyms.h"
+#include "gdkx.h"
 
 #include "circles.xbm"